#include "logindialog.h"
#include "ui_logindialog.h"

LoginDialog::LoginDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::LoginDialog)
{
    ui->setupUi(this);
}

LoginDialog::LoginDialog(QWidget *parent, const QString& username, const QString& password)
    : QDialog(parent)
    , ui(new Ui::LoginDialog)
{
    ui->setupUi(this);
    setUserName(username);
    setPassword(password);
}

LoginDialog::~LoginDialog()
{
    delete ui;
}

void LoginDialog::accept()
{
    QDialog::accept();
    qDebug("accept");
}
void LoginDialog::setUserName(const QString& username)
{
    ui->userLineEdit->setText(username);
}

void LoginDialog::setPassword(const QString& password)
{
    ui->passwordLineEdit->setText(password);
}
